<%--
 用户约课界面
  User: gyy
  Date: 2021-04-08
  Time: 11:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html lang="en">

<head>
    <c:import url="commons.jsp"></c:import>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>SB Admin</title>
    <!-- Bootstrap core CSS-->
    <link href="${pd}/statics/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- Custom fonts for this template-->
    <link href="${pd}/statics/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!-- Page level plugin CSS-->
    <link href="${pd}/statics/vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">
    <!-- Custom styles for this template-->
    <link href="${pd}/statics/css/sb-admin.css" rel="stylesheet">
  <script src="${pd}/statics/js/jquery.js"></script>
        <script>
            function deleteAlert(){
                var flag=confirm("确认删除吗？");
                if(flag){
                    $("#btn").submit();
                }else {
                    return;
                }
            }
        </script>
<script>
        //全选
        function selectUserAll(obj) {
            console.log(obj);
            if (obj.checked == true) {
                //打开全选，下面的所有选择框都祖选择
                $("[name='ids']").prop("checked",true);
            } else {
                //关闭全选
                $("[name='ids']").prop("checked",false);
            }
        }
    </script>
<%--<script>--%>
<%--    $(function (){--%>
<%--        $("tr").each(function () {--%>
<%--            var state = $(this).children("td:eq(8)").text();--%>
<%--            console.log(state);--%>
<%--            if (state == "已预约") {--%>
<%--                // $(this).children("td:eq(8)").css("color", "greenyellow");--%>
<%--                $(this).children("td:eq(9)").style().display="none";--%>
<%--                $(this).children("td:eq(10)").style().display="block";--%>
<%--            } else if (state == "未预约") {--%>
<%--                // $(this).children("td:eq(8)").css("color", "red");--%>
<%--                $(this).children("td:eq(9)").style().display="block";--%>
<%--                $(this).children("td:eq(10)").style().display="none";--%>
<%--            }--%>
<%--        });--%>
<%--    });--%>
<%--</script>--%>

</head>

<body class="fixed-nav sticky-footer bg-dark" id="page-top">

<c:import url="userNav.jsp"></c:import>
<div class="content-wrapper">
    <div class="container-fluid">
        <!-- 用户信息-->
        <div class="card mb-3">
            <div class="card-header">
                <i class="fa fa-table"></i> 用户信息</div>

            <div class="card-body">
                <div class="table-responsive">
                  <form action="adminDelect.action" method="post" >
                    <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                        <thead>
                        <tr>
                            <th> <input type="checkbox" onclick="selectUserAll(this)"></th>
                            <th>课程名称</th>
                            <th>俱乐部名称</th>
                            <th>教练名称</th>
                            <th>开课时间</th>
                            <th>课时费</th>
                            <th>课程时长</th>
                            <th>锻炼次数</th>
                            <th>预约状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>

                        <tbody>
                        <c:forEach var="courseOrder" items="${clList}">

                            <tr>
                                <td><input name="ids" type="checkbox" value="${courseOrder.cId}" /></td>
                                <td>${courseOrder.cName}</td>
                                <td>${courseOrder.clName}</td>
                                <td>${courseOrder.coName}</td>
                                <td>${courseOrder.cDate}</td>
                                <td>${courseOrder.cMoney}</td>
                                <td>${courseOrder.coTime}</td>
                                <td>${courseOrder.number}</td>
                                <td>${courseOrder.oStatus}</td>

<%--                                <td>--%>
<%--                                    <input class="btn btn-yellow btn-w-md" onclick="javascript:location.href='orderByOid.action?oId=${courseOrder.oId}&&lId=${courseOrder.lId}'"--%>
<%--                                           value="预约" type="button" />--%>
<%--                                </td>--%>

                                <td>
                                    <input class="btn btn-yellow btn-w-md" onclick="javascript:location.href='courseorderdelete.action?oId=${courseOrder.oId}&&lId=${courseOrder.lId}'"
                                           value="取消预约" type="button" />
                                </td>

                            </tr>
                        </c:forEach>
                        </tbody>

                    </table>

                    <div style="text-align: center">
                            <input class="btn btn-yellow btn-w-md" value="删除" type="submit" onclick="deleteAlert()"   id="btn"/>
                    </div>
                  </form>
                </div>
                </div>
            </div>
        </div>
    </div>


    <!-- Bootstrap core JavaScript-->
<%--    <script src="statics/vendor/jquery/jquery.min.js"></script>--%>
    <script src="${pd}/statics/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
    <!-- Core plugin JavaScript-->
    <script src="${pd}/statics/vendor/jquery-easing/jquery.easing.min.js"></script>
    <!-- Page level plugin JavaScript-->
<%--    <script src="statics/vendor/datatables/jquery.dataTables.js"></script>--%>
    <script src="${pd}/statics/vendor/datatables/dataTables.bootstrap4.js"></script>
    <!-- Custom scripts for all pages-->
    <script src="${pd}/statics/js/sb-admin.min.js"></script>
    <!-- Custom scripts for this page-->
    <script src="${pd}/statics/js/sb-admin-datatables.min.js"></script>
</div>
</body>

</html>
